﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Page_FManager.aspx.cs" Inherits="SGManager_Page_FManager" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>房源管理</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>

        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
            DataKeyNames="ID" DataSourceID="AccessDataSource1" 
            EnableModelValidation="True" AllowPaging="True" 
            onselectedindexchanged="GridView1_SelectedIndexChanged">
            <Columns>
                <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
                <asp:BoundField DataField="ID" HeaderText="ID" 
                    ReadOnly="True" SortExpression="ID" />
                <asp:BoundField DataField="areaID" HeaderText="区域ID" 
                    SortExpression="areaID" />
                <asp:BoundField DataField="address" HeaderText="地址" 
                    SortExpression="address" />
                <asp:BoundField DataField="floor" HeaderText="楼层" SortExpression="floor" />
                <asp:BoundField DataField="proportionSum" HeaderText="面积" 
                    SortExpression="proportionSum" />
                <asp:BoundField DataField="rental" HeaderText="租金" 
                    SortExpression="rental" />
                <asp:BoundField DataField="owner" HeaderText="联系人" SortExpression="owner" />
                <asp:BoundField DataField="ownerPhone" HeaderText="联系人电话" 
                    SortExpression="ownerPhone" />
                <asp:BoundField DataField="remark" HeaderText="备注" 
                    SortExpression="remark" />
            </Columns>
        </asp:GridView>
        <asp:AccessDataSource ID="AccessDataSource1" runat="server" 
            DataFile="~/App_Data/TMDataBase.mdb" 
            DeleteCommand="DELETE FROM [TB_House] WHERE (([ID] = '?') OR ([ID] IS NULL AND ? IS NULL))" 
            InsertCommand="INSERT INTO [TB_House] ([ID], [areaID], [address], [floor], [proportionSum], [rental], [owner], [ownerPhone], [remark]) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)" 
            SelectCommand="SELECT * FROM [TB_House]" 
            UpdateCommand="UPDATE [TB_House] SET [areaID] = ?, [address] = ?, [floor] = ?, [proportionSum] = ?, [rental] = ?, [owner] = ?, [ownerPhone] = ?, [remark] = ? WHERE (([ID] = ?) OR ([ID] IS NULL AND ? IS NULL))">
            <DeleteParameters>
                <asp:Parameter Name="ID" Type="String" />
            </DeleteParameters>
            <InsertParameters>
                <asp:Parameter Name="ID" Type="String" />
                <asp:Parameter Name="areaID" Type="Int32" />
                <asp:Parameter Name="address" Type="String" />
                <asp:Parameter Name="floor" Type="String" />
                <asp:Parameter Name="proportionSum" Type="Int32" />
                <asp:Parameter Name="rental" Type="String" />
                <asp:Parameter Name="owner" Type="String" />
                <asp:Parameter Name="ownerPhone" Type="String" />
                <asp:Parameter Name="remark" Type="String" />
            </InsertParameters>
            <UpdateParameters>
                <asp:Parameter Name="areaID" Type="Int32" />
                <asp:Parameter Name="address" Type="String" />
                <asp:Parameter Name="floor" Type="String" />
                <asp:Parameter Name="proportionSum" Type="Int32" />
                <asp:Parameter Name="rental" Type="String" />
                <asp:Parameter Name="owner" Type="String" />
                <asp:Parameter Name="ownerPhone" Type="String" />
                <asp:Parameter Name="remark" Type="String" />
                <asp:Parameter Name="ID" Type="String" />
            </UpdateParameters>
        </asp:AccessDataSource>
    </div>
    </form>
</body>
</html>
